package com.example.demo.mq.activemq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

import javax.jms.Destination;

/**
 * Created by Wen Gao on 2018/7/12.
 */
@Component
public class JMSProducer {

    @Autowired
    private JmsTemplate jmsTemplate;

    public void enqueue(Destination destination, String message) {
        this.jmsTemplate.convertAndSend(destination,message);
    }

}